import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import tailwindcss from '@tailwindcss/vite'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import vueSetupExtend from 'vite-plugin-vue-setup-extend'
import { vitePluginForArco } from '@arco-plugins/vite-vue'
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
import { ArcoResolver } from 'unplugin-vue-components/resolvers';
import path from 'path'
import { resolve } from 'path'
// https://vite.dev/config/
export default defineConfig({
    base: '/admin/',
    plugins: [
        vue(),
        tailwindcss(),
        vitePluginForArco({
            style: 'css'
        }),
        AutoImport({
            imports: [
                'vue',
                'vue-router',
            ],
            eslintrc: {
                enabled: true,
                filepath: './.eslintrc-auto-import.json',
                globalsPropValue: true,
            },
            dts: 'src/auto-imports.d.ts',
            resolvers: [ArcoResolver()],
        }),
        Components({
            directoryAsNamespace: true,
            resolvers: [ArcoResolver({
                sideEffect: true,
            })],
        }),
        vueSetupExtend(),
        createSvgIconsPlugin({
            iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')],
            symbolId: 'local-icon-[dir]-[name]',

        }),
    ],

    server: {
        // ... 其他开发服务器配置
    },
    resolve: {
        alias: {
            '@': resolve(__dirname, 'src')
        },
    },

})
